package action.commande;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

import service.securite.DroitsAcces;
import action.general.NotreServlet;

public class PaiementAction extends NotreServlet {
	private static final long serialVersionUID = -9031835013975721017L;


	public ActionForward execute(final ActionMapping pMapping,
			ActionForm pForm, final HttpServletRequest pRequete,
			final HttpServletResponse pReponse) {
		ActionErrors errors = new ActionErrors();
		super.execute(pMapping,pForm,pRequete,pReponse);
		
		if (!DroitsAcces.isConnecte(pRequete)) {
			errors.add("errors",new ActionMessage("errors.droit"));
			saveErrors(pRequete,errors); 
			return (new ActionForward(pMapping.getInput()));
		}

		return pMapping.findForward("success");
		}


}
